﻿@model EquipmentModelEditModel
@{
    if (Model == null || Model.Id == 0)
    {
        ViewBag.Title = "新增新设备年限";
    }
    else
    { ViewBag.Title = "修改设备年限"; }
}
@section JS
{
    <script src="@Url.Content("~/Scripts/EquipmentModel.js")" type="text/javascript"></script>
}
@section BodyNav{
    > @Html.ActionLink("设备年限列表", "List", "Company") > @ViewBag.Title
}
@using (Html.BeginForm())
{
    <table class="window">
        <tr class="head">
            <th colspan="2">@ViewBag.Title
            </th>
        </tr>
        <tr>
            <th width="140">
                @Html.LabelFor(m => m.Name)
            </th>
            <td width="300">
                @if (Model != null && Model.Id > 0)
                {
                    @Html.DisplayFor(t => t.Name)
                    @Html.HiddenFor(m => m.Name)
                }
                else
                {
                    @Html.EditorFor(m => m.Name)
                    @Html.ValidationMessageFor(m => m.Name)
                }
            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(m => m.LimitedYear)
            </th>
            <td>@Html.EditorFor(m => m.LimitedYear)@Html.ValidationMessageFor(m => m.LimitedYear)
            </td>
        </tr>
        <tr>
            <td colspan="2">
                @if (Model != null && Model.Id > 0)
                {
                    @Html.HiddenFor(m => m.Id)
                }
                <input type="submit" value="保存" class="btnBtn" />
                @Html.ActionLink("返回列表", "List", "EquipmentModel", null, new { @class = "lnkBtn" })
            </td>
        </tr>
    </table>
}